{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import urllib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "imgurls = ['https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1018687198,174914688&fm=15&gp=0.jpg',\n",
    "                \"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2149310024,255707060&fm=26&gp=0.jpg\",\n",
    "                \"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2105937605,2474047205&fm=15&gp=0.jpg\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "图片开始下载，注意查看文件夹\n",
      "图片开始下载，注意查看文件夹\n",
      "图片开始下载，注意查看文件夹\n"
     ]
    }
   ],
   "source": [
    "x = 0\n",
    "for imgurl in imgurls:\n",
    "    urllib.request.urlretrieve(imgurl, '{}.jpg'.format(x))  # 打开imgList,下载图片到本地\n",
    "    x = x + 1\n",
    "    print('图片开始下载，注意查看文件夹')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
